package com.baizhi.controller;

import com.baizhi.entity.Admin;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
public class TestController {
    /**
     * @Value("${server.port}") 获取application配置文件中的值
     */
    @Value("${server.port}")
    private String port;

    @RequestMapping("test")
    public String test(@RequestParam String name){
        return "我是生产者，端口号："+port+"，内容是："+name;
    }


    @RequestMapping("testMap")
    public String testMap(String name,String password){
        return "我是生产者，端口号："+port+"，内容是："+name+password;
    }




    /**
     * 对象的接受
     * 1.port
     * 2.@RequestBody
     * @param admin
     * @return
     */


    //feign
   @PostMapping("testAdmin")
    public Admin testAdmin(@RequestBody Admin admin){

        return admin;
    }
}
